package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.system.domain.vo.SlicesDetailVo;
import com.ruoyi.system.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TimeSlicesMapper;
import com.ruoyi.system.domain.TimeSlices;
import com.ruoyi.system.service.ITimeSlicesService;

/**
 * 时间片Service业务层处理
 * 
 * @author Wu Zhongfu
 * @date 2022-02-07
 */
@Service
public class TimeSlicesServiceImpl implements ITimeSlicesService 
{
    @Autowired
    private TimeSlicesMapper timeSlicesMapper;

    /**
     * 查询时间片
     * 
     * @param id 时间片主键
     * @return 时间片
     */
    @Override
    public TimeSlices selectTimeSlicesById(Long id)
    {
        return timeSlicesMapper.selectTimeSlicesById(id);
    }

    /**
     * 查询时间片列表
     * 
     * @param timeSlices 时间片
     * @return 时间片
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "u")
    public List<TimeSlices> selectTimeSlicesList(TimeSlices timeSlices)
    {
        return timeSlicesMapper.selectTimeSlicesList(timeSlices);
    }

    @Override
    public List<SlicesDetailVo> listByFreeTimeId(Integer freeTimeId){
        return timeSlicesMapper.listByFreeTimeId(freeTimeId);
    }

    @Override
    public List<SlicesDetailVo> listByDetails(SlicesDetailVo timeSlices) {
        return timeSlicesMapper.listByDetails(timeSlices);
    }

    /**
     * 新增时间片
     * 
     * @param timeSlices 时间片
     * @return 结果
     */
    @Override
    public int insertTimeSlices(TimeSlices timeSlices)
    {
        return timeSlicesMapper.insertTimeSlices(timeSlices);
    }

    /**
     * 修改时间片
     * 
     * @param timeSlices 时间片
     * @return 结果
     */
    @Override
    public int updateTimeSlices(TimeSlices timeSlices)
    {
        return timeSlicesMapper.updateTimeSlices(timeSlices);
    }

    /**
     * 批量删除时间片
     * 
     * @param ids 需要删除的时间片主键
     * @return 结果
     */
    @Override
    public int deleteTimeSlicesByIds(Long[] ids)
    {
        return timeSlicesMapper.deleteTimeSlicesByIds(ids);
    }

    /**
     * 删除时间片信息
     * 
     * @param id 时间片主键
     * @return 结果
     */
    @Override
    public int deleteTimeSlicesById(Long id)
    {
        return timeSlicesMapper.deleteTimeSlicesById(id);
    }

    @Override
    public int deleteTimeSlicesByFreeId(Integer id)
    {
        return timeSlicesMapper.deleteTimeSlicesByFreeId(id);
    }


}
